class Solution {//leetcode455——分发饼干
public:
    int findContentChildren(vector<int>& g, vector<int>& s) {
        int n=g.size(),m=s.size();
        sort(g.begin(),g.end());
        sort(s.begin(),s.end());
        int min_chir=0;
        int ret=0;
        for(int i=0;i<m;i++){
            if(g[min_chir]<=s[i]){
                ret++;
                min_chir++;
                if(min_chir>=n) break;
            }
        }
        return ret;
    }
};